
const spans = document.querySelectorAll('.dt span')
const cards = document.querySelectorAll('.card')

for (var i = 0; i < spans.length; i++) {
  spans[i].addEventListener('click', function () {
    for (var j = 0; j < spans.length; j++) {
      spans[j].classList.remove('active')
      cards[j].classList.remove('show')
    }
    this.classList.add('active')

    let index = this.getAttribute('data-index')
    cards[index].classList.add('show')
  })
}


/*
for (let i = 0; i < spans.length; i++) {
  spans[i].addEventListener('click', function () {
    console.log(i)
  })
}*/
